package com.ruoyi.worker.domain.v2;

import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.worker.constant.AttendanceSignResultEnum;
import lombok.Data;

import java.util.Date;

/**
 * @author: 陈宇寰
 * @date: 2021-12-25 21:18:25
 * @params:
 * @return:
 * @description: V1.2版本 日考勤打卡记录主表
 */
@Data
public class RzAttendanceSumDailyRecordV2Domain extends BaseEntity {

    private Integer id;
    /**
     * 对应排班ID
     */
    private Integer staffPlanId;
    /**
     * 异常打卡次数
     */
    private Integer numberOfAbnormal;

    /**
     * 离职数
     */
    private Integer numberOfQuit;
    /**
     * 普通迟到次数
     */
    private Integer numberOfLate;
    /**
     * 一般迟到次数
     */
    private Integer numberOfNormallyLate;
    /**
     * 严重迟到次数
     */
    private Integer numberOfSeriouslyLate;
    /**
     * 早退次数
     */
    private Integer numberOfLeaveEarly;
    /**
     * 旷工次数
     */
    private Integer numberOfAbsenteeism;

    /**
     * 工伤数
     */
    private Integer numberOfInjure;

    /**
     * 休息数
     */
    private Integer numberOfRest;

    /**
     * 请假数
     */
    private Integer numberOfLeave;

    /**
     * 出勤结果 1-出勤，0-未出勤
     */
    private Integer result;

    /**
     * 排班类型 1-白班，2-晚班
     */
    private Integer workType;

    /**
     * 排班日期
     */
    private Date scheduleDate;

    /**
     * 关联考勤组ID
     */
    private Integer attendanceGroupId;

    /**
     * 关联班组ID
     */
    private Integer deptId;

    /**
     * 确认状态
     */
    private Integer status ;

    public RzAttendanceSumDailyRecordV2Domain() {
    }

    public RzAttendanceSumDailyRecordV2Domain(Long staffPlanId, Integer workType, Date scheduleDate,
                                              Integer attendanceGroupId, Long deptId) {
        this.staffPlanId = Math.toIntExact(staffPlanId);
        this.workType = workType;
        this.scheduleDate = scheduleDate;
        this.attendanceGroupId = attendanceGroupId;
        this.deptId = Math.toIntExact(deptId);
        this.numberOfAbnormal = 0;
        this.numberOfLate = 0;
        this.numberOfNormallyLate = 0;
        this.numberOfSeriouslyLate = 0;
        this.numberOfLeaveEarly = 0;
        this.numberOfAbsenteeism = 0;
        this.numberOfInjure = 0;
        this.numberOfLeave = 0;
        this.numberOfRest = 0;
        this.numberOfQuit = 0;
        this.result = 0;
    }
}
